/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package Golf_Manager.vo;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Administrator
 */
public class Group {
    
    private int groupRow;
    private String groupName;
    private int groupMemberCnt;
    
    private int memberRow1 = -1;
    private String memberSeq1;
    private String memberDesc1;
    
    private int memberRow2 = -1;
    private String memberSeq2;
    private String memberDesc2;
    
    private int memberRow3 = -1;
    private String memberSeq3;
    private String memberDesc3;
    
    private int memberRow4 = -1;
    private String memberSeq4;
    private String memberDesc4;
    
    public Group(int  groupRow, String groupName, int groupMemberCnt) {
        this.groupRow = groupRow;
        this.groupName = groupName;
        this.groupMemberCnt = groupMemberCnt;
    }

    public int getGroupRow() {
        return groupRow;
    }

    public void setGroupRow(int groupRow) {
        this.groupRow = groupRow;
    }

    public String getGroupName() {
        return groupName;
    }

    public void setGroupName(String groupName) {
        this.groupName = groupName;
    }

    public int getGroupMemberCnt() {
        return groupMemberCnt;
    }

    public void setGroupMemberCnt(int groupMemberCnt) {
        this.groupMemberCnt = groupMemberCnt;
    }
    
    public int getMemberRow1() {
        return memberRow1;
    }

    public void setMemberRow1(int memberRow1) {
        this.memberRow1 = memberRow1;
    }
    
    public String getMemberSeq1() {
        return memberSeq1;
    }

    public void setMemberSeq1(String memberSeq1) {
        this.memberSeq1 = memberSeq1;
    }
    
    public String getMemberDesc1() {
        return memberDesc1;
    }

    public void setMemberDesc1(String memberDesc1) {
        this.memberDesc1 = memberDesc1;
    }

    public int getMemberRow2() {
        return memberRow2;
    }

    public void setMemberRow2(int memberRow2) {
        this.memberRow2 = memberRow2;
    }
    
    public String getMemberSeq2() {
        return memberSeq2;
    }

    public void setMemberSeq2(String memberSeq2) {
        this.memberSeq2 = memberSeq2;
    }
    
    public String getMemberDesc2() {
        return memberDesc2;
    }

    public void setMemberDesc2(String memberDesc2) {
        this.memberDesc2 = memberDesc2;
    }

    public int getMemberRow3() {
        return memberRow3;
    }

    public void setMemberRow3(int memberRow3) {
        this.memberRow3 = memberRow3;
    }
    
    public String getMemberSeq3() {
        return memberSeq3;
    }

    public void setMemberSeq3(String memberSeq3) {
        this.memberSeq3 = memberSeq3;
    }
    
    public String getMemberDesc3() {
        return memberDesc3;
    }

    public void setMemberDesc3(String memberDesc3) {
        this.memberDesc3 = memberDesc3;
    }

    public int getMemberRow4() {
        return memberRow4;
    }

    public void setMemberRow4(int memberRow4) {
        this.memberRow4 = memberRow4;
    }

    public String getMemberSeq4() {
        return memberSeq4;
    }

    public void setMemberSeq4(String memberSeq4) {
        this.memberSeq4 = memberSeq4;
    }
    
    public String getMemberDesc4() {
        return memberDesc4;
    }

    public void setMemberDesc4(String memberDesc4) {
        this.memberDesc4 = memberDesc4;
    }

    @Override
	public String toString() {
		Class cls = this.getClass();
		Method[] arrMethod = cls.getMethods();
		StringBuilder sb = new StringBuilder(this.getClass().toString());
		sb.append(" => ");
		
		try {
			for(Method m : arrMethod) {
				if(m.getName().startsWith("get") && !m.getName().equals("getClass")) { 
					sb.append(m.getName());
					sb.append(": ");
					sb.append(m.invoke(this));
					sb.append(", ");
				}
			}
		} catch (IllegalArgumentException | IllegalAccessException | InvocationTargetException e) {
			Logger.getLogger(Member.class.getName()).log(Level.SEVERE, null, e);
		}
		
		return sb.toString().substring(0, sb.length() - 2);
	}
}
